//
//  YIHome.m
//  一点互助
//
//  Created by rimi on 16/8/19.
//  Copyright © 2016年 shen. All rights reserved.
//

#import "YIHome.h"
#import "YITableView.h"
#import "YILocation.h"
@interface YIHome ()
@property(nonatomic,strong)YITableView *tableView;
@end

@implementation YIHome

- (void)viewDidLoad {
    [super viewDidLoad];
//       self.automaticallyAdjustsScrollViewInsets = NO;
       self.view.backgroundColor = [UIColor colorWithRed:244/255.0 green:244/255.0 blue:244/255.0 alpha:1];
       [self.view addSubview:self.tableView];
       self.title = @"发布愿望";
       [self setNavBarItem];
       [self netWorking];
}
-(void)netWorking{
       
//       [YINetWorkingManager POSTWithURL:@"g=Appapi&m=index&a=getToken" parameters:nil success:^(id responseObject) {
//                     PLLOG(@"%@",responseObject);
//              } filed:^(NSError *error) {
//       
//              }];
//       [YINetWorkingManager GETWithURL:@"g=Appapi&m=wish&a=index&token={token:3befbfbbe0e5e8b56d6023b97fc7be69afbc88be}" parameters:nil success:^(id responseObject) {
//              PLLOG(@"%@",responseObject);
//       } filed:^(NSError *error) {
//              PLLOG(@"%@",error);
//       }];

}
-(void)setNavBarItem{
       UIBarButtonItem *imageItem = [[UIBarButtonItem alloc] initWithCustomView:[YINavigationBar setItem:self click:@selector(click)]];
       self.navigationItem.leftBarButtonItem = imageItem;
       self.navigationItem.titleView = [YINavigationBar setTitleView:@"项目 用户" who:self click:@selector(search)];
}
-(void)setSearch{
       
}
-(void)click{
       YILocation *location = [[YILocation alloc]init];
       [self.navigationController pushViewController:location animated:YES];
}
-(void)search{
       YISearch *search = [[YISearch alloc]init];
       [self.navigationController pushViewController:search animated:YES];
}
-(YITableView *)tableView{
       if (!_tableView) {
              _tableView = [[YITableView alloc]initWithFrame:self.view.bounds];
       }
       return _tableView;
}

@end
